package com.zhouixi.repository;

import com.zhouixi.entity.MessageEntity;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

// 消息DAO
@Repository
public interface MessageRepository extends JpaRepository<MessageEntity, Long> {
    // 查询用户历史消息
    List<MessageEntity> findBySenderIdAndReceiverIdOrderByTimestampDesc(
            String senderId, String receiverId, Pageable pageable);


    MessageEntity findByMsgId(String msgId);
}